home *** CD-ROM | disk | FTP | other *** search
Wrap
; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! [Setup] AppName=Cottage Of Doom AppVerName=Cottage Of Doom 1.0 AppPublisher=Alex May AppPublisherURL=http://sourceforge.net/projects/catrpg AppSupportURL=http://sourceforge.net/projects/catrpg AppUpdatesURL=http://sourceforge.net/projects/catrpg DefaultDirName={pf}\Cottage Of Doom DefaultGroupName=Cottage Of Doom AllowNoIcons=yes LicenseFile=C:\Project\neoneko\CottageOfDoom\CottageOfDoom\gpl.txt InfoAfterFile=C:\Project\neoneko\CottageOfDoom\CottageOfDoom\readme.txt OutputBaseFilename=cottageofdoomsetup1.0 Compression=lzma SolidCompression=yes [Languages] Name: english; MessagesFile: compiler:Default.isl [Tasks] Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked [Files] Source: C:\Project\neoneko\CottageOfDoom\CottageOfDoom\DoomCottage.exe; DestDir: {app}; Flags: ignoreversion Source: C:\Project\neoneko\CottageOfDoom\CottageOfDoom\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons] Name: {group}\Cottage Of Doom; Filename: {app}\DoomCottage.exe; WorkingDir: {app}\; Tasks: ; Languages: ; IconFilename: {app}\doomcottage.ico Name: {group}\Cottage Of Doom (Vista); Filename: {app}\DoomCottage-VistaCompatible.exe; WorkingDir: {app}\; Tasks: ; Languages: ; IconFilename: {app}\doomcottage.ico Name: {group}\{cm:UninstallProgram,Cottage Of Doom}; Filename: {uninstallexe} Name: {commondesktop}\Cottage Of Doom; Filename: {app}\DoomCottage.exe; Tasks: desktopicon; WorkingDir: {app}\; IconFilename: {app}\doomcottage.ico [Run] Filename: {app}\DoomCottage-VistaCompatible.exe; Description: {cm:LaunchProgram,Cottage Of Doom}; Flags: nowait postinstall skipifsilent [Code] dotnetRedistPath: string; downloadNeeded: boolean; dotNetNeeded: boolean; memoDependenciesNeeded: string; procedure isxdl_AddFile(URL, Filename: PChar); external 'isxdl_AddFile@files:isxdl.dll stdcall'; function isxdl_DownloadFiles(hWnd: Integer): Integer; external 'isxdl_DownloadFiles@files:isxdl.dll stdcall'; function isxdl_SetOption(Option, Value: PChar): Integer; external 'isxdl_SetOption@files:isxdl.dll stdcall'; const dotnetRedistURL = 'http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe'; // local system for testing... // dotnetRedistURL = 'http://192.168.1.1/dotnetfx.exe'; function InitializeSetup(): Boolean; begin Result := true; dotNetNeeded := false; // Check for required netfx installation //if (not GetUserDefaultLangID() = 'English') then begin //msgbox('Language Is Not English'); //end; if (not RegKeyExists(HKLM, 'Software\Microsoft\.NETFramework\policy\v2.0')) then begin dotNetNeeded := true; if (not IsAdminLoggedOn()) then begin MsgBox('Cottage Of Doom needs the Microsoft .NET Framework 2.0 to be installed by an Administrator', mbInformation, MB_OK); Result := false; end else begin memoDependenciesNeeded := memoDependenciesNeeded + ' .NET Framework 2.0' #13; dotnetRedistPath := ExpandConstant('{src}\dotnetfx.exe'); if not FileExists(dotnetRedistPath) then begin dotnetRedistPath := ExpandConstant('{tmp}\dotnetfx.exe'); if not FileExists(dotnetRedistPath) then begin isxdl_AddFile(dotnetRedistURL, dotnetRedistPath); downloadNeeded := true; end; end; SetIniString('install', 'dotnetRedist', dotnetRedistPath, ExpandConstant('{tmp}\dep.ini')); end; end; function NextButtonClick(CurPage: Integer): Boolean; hWnd: Integer; ResultCode: Integer; begin Result := true; if CurPage = wpReady then begin hWnd := StrToInt(ExpandConstant('{wizardhwnd}')); // don't try to init isxdl if it's not needed because it will error on < ie 3 if downloadNeeded then begin isxdl_SetOption('label', 'Downloading Microsoft .NET Framework 2.0'); isxdl_SetOption('description', 'Cottage Of Doom needs to install the Microsoft .NET Framework 2.0. Please wait while Setup is downloading extra files to your computer.'); if isxdl_DownloadFiles(hWnd) = 0 then Result := false; end; if (Result = true) and (dotNetNeeded = true) then begin if Exec(ExpandConstant(dotnetRedistPath), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then begin // handle success if necessary; ResultCode contains the exit code if not (ResultCode = 0) then begin Result := false; end; end else begin // handle failure if necessary; ResultCode contains the error code Result := false; end; end; end; function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String; s: string; begin if memoDependenciesNeeded <> '' then s := s + 'Dependencies that will be automatically downloaded And installed:' + NewLine + memoDependenciesNeeded + NewLine; s := s + MemoDirInfo + NewLine + NewLine; Result := s